package com.deryun.tyl.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.deryun.tyl.bean.Industry;
import com.deryun.tyl.dao.impl.IndustryDaoImpl;

@Service("industryServiceImpl")
public class IndustryServiceImpl {
	
	@Resource(name = "industryDaoImpl")
	private IndustryDaoImpl industryDaoImpl;
	
	public List<Industry> getAllIndustry(){
		return industryDaoImpl.getAllIndustry();
	}
	
	
	public int addIndustry(Industry industry){
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		industry.setPublishDate(df.format(new Date()));
		return industryDaoImpl.addIndustry(industry);
	}
	
	
	public int deleteIndustry(int id){
		return industryDaoImpl.deleteIndustry(id);
		
	}
}
